module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const TargetSchema = new Schema({
        url: String, // 目标链接地址
        name: {
            type: String,
            default: ''
        }, // 目标地址描述
        shareType: { // 分享类型 0 小程序 1 外部链接
            type: Number,
            default: 0
        },
        tag: Number, // 标签
        creator: { type: Schema.Types.ObjectId, ref: 'User' }, // 创建者
    }, { timestamps: { createdAt: 'createDate', updatedAt: 'updateDate' } });
    return mongoose.model('Target', TargetSchema);
}